package beautiful.butterfly.distributed_task_processing_engine.tools;

import lombok.extern.slf4j.Slf4j;

import java.net.InetAddress;

@Slf4j
public class LocalHostAddress
{
    public static String getLocalHostName()
    {
        try
        {
            return InetAddress.getLocalHost().getHostName();
        } catch (Exception e)
        {
            e.printStackTrace();
            log.error(e.getMessage());
            return null;
        }
    }

    public static String getLocalHostAddress()
    {
        try
        {
            return InetAddress.getLocalHost().getHostAddress();
        } catch (Exception e)
        {
            e.printStackTrace();
            log.error(e.getMessage());
            return null;
        }
    }
}
